Skip to content

C++: Model taint flow through std::string constructor and c_str()#3195

Merged
jbj merged 8 commits into
github:masterfrom
geoffw0:taintstring
Apr 3, 2020
Merged

C++: Model taint flow through std::string constructor and c_str()#3195
jbj merged 8 commits into
github:masterfrom
geoffw0:taintstring

Conversation

@geoffw0

@geoffw0 geoffw0 commented Apr 2, 2020

Copy link
Copy Markdown
Contributor

This is a very incomplete model of std::string, based on #1637 but a less ambitious starting point. I have put in the tests for operator<< as well but it's not yet modeled.

@jbj jbj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM!

/**
* The `std::basic_string` constructor(s).
*/
class StringConstructor extends TaintFunction {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the term "string" means so many different things in C/C++, I'd prefer more precise names for this file and its classes: StdString.qll, StdStringConstructor, StdStringCStr.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

@jbj jbj merged commit 16c7a35 into github:master Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants